<!DOCTYPE html>
<html lang="en">
<head>
    <base href="http://localhost:8080">
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--bootstrap插件-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link href="/static/plugin/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/plugin/jo/joUI.css" rel="stylesheet"/>
    <!--字体插件-->
    <link href="/static/plugin/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/plugin/layui-2.4.3/css/layui.css" rel="stylesheet"/>
    <!--ztree-->
    <link href="/static/plugin/zTree/css/metroStyle/metroStyle.css" rel="stylesheet"/>
    <!--common-->
    <!--<link href="/static/css/common.css" rel="stylesheet"/>-->
    <!--H+首页相关css-->
    <link href="/static/plugin/index_hplus/css/animate.min.css" rel="stylesheet">
    <link href="/static/plugin/index_hplus/css/style.min862f.css" rel="stylesheet">
    <!--h+样式调整-->
    <link href="/static/plugin/index_hplus/ext.css" rel="stylesheet">
    <title>首页</title>
    <style>
        .top-menu-bar{
            float:left;
            margin: 0px 50px 0px 0px;
            padding: 0px;
            font-size: 16px;
            font-weight: 400;
        }
        .top-menu-item{
            float: left;
            color: #FFFFFF;
            width: 117px;
            height: 100%;
            text-align: center;
            background-color: transparent;
            cursor: pointer;
            padding: 0px 1px;
        }
        .top-menu-item-more{
            width: 95px;
        }
        .top-menu-item>a{
            color: #FFFFFF;
        }
        .top-menu-item:hover{
            background-color: rgba(0, 0, 0, 0.1);
            font-weight: 700;
            text-decoration: underline;
            color: #F1F4F5;
        }
        .top-menu-bar .active{/*当前活动菜单*/
            background-color: rgba(0, 0, 0, 0.1);
            font-weight: 700;
            text-decoration: underline;
            color: #F1F4F5;
        }
        .top-menu-bar::after{
            content: '';
            display: block;
            clear: both;
        }
        .tools-ul{
            padding-right: 12px;float:left;
        }
        .tools-ul li{
            width: auto;
        }
    </style>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">

<div id="wrapper">
    <!--左侧导航开始-->
    <nav class="navbar-default navbar-static-side" role="navigation" style="background-color: rgb(38, 50, 56);">
        <div class="nav-close"><i class="fa fa-times-circle"></i>
        </div>
        <div class="sidebar-collapse">
            <ul class="nav" id="side-menu">
                <!--<li style="height: 42px;line-height: 42px;padding-left: 22px;color: #76838f;font-size: 12px;">菜单栏</li>-->
                <!--<li>
                    <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">代码生成</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/umsConfigList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">UMS配置</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/userList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">用户管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/ssoSessionList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">SSO会话管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/loginLogList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">登录日志</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/deptList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">组织机构管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/deptUserList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">部门用户管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/roleList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">角色管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/navigateList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">资源管理</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/grantAuth.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">授权</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/roleNavigateList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">角色资源</span>
                    </a>
                </li>
                <li>
                    <a class="J_menuItem" href="{URL_UMS}page/ums/roleUserList.html" data-index="1">
                        <i class="fa fa-list fa-fw"></i>
                        <span class="nav-label">角色用户</span>
                    </a>
                </li>-->
            </ul>
        </div>
    </nav>
    <!--左侧导航结束-->
    <!--右侧部分开始-->
    <div id="page-wrapper" class="gray-bg dashbard-1">
        <div class="row border-bottom">
            <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0;height: 60px;">
                <div class="head-bar bg-head" style="/*background-image: url('/static/images/wjy.jpg');*/background-size: 100% 100%;overflow: hidden;">
                    <!--logo区域-->
                    <div class="logo-bar">
                        <i class="fa fa-2x fa-diamond" aria-hidden="true"></i>&nbsp;
                        <!--<img src="<%=URL_STATIC%>static/images/bg.png" style="width: 45px;height: 45px;margin: 0px;padding: 0px;"/>-->
                        <span style="font-size: 18px;">YoungCloud--面向云的开发平台</span>
                    </div>
                    <!--/logo区域-->
                    <!--顶部工具栏-->
                    <div class="head-tools-bar">
                        <ul class="top-menu-bar">
                            <!--<li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>
                            <li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>
                            <li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>
                            <li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>
                            <li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>
                            <li class="top-menu-item">
                                <a class="J_menuItem" href="{URL_CMS}page/cms/gen/genMainList.html" data-index="1">
                                    <i class="fa fa-list fa-fw"></i>
                                    <span class="nav-label">统一用户</span>
                                </a>
                            </li>-->
                        </ul>
                        <ul class="tools-ul">
                            <li style="font-size: 20px;padding: 0px 10px;" data-toggle="popover" title="" data-container="body" data-trigger="hover"
                                data-toggle="popover" data-placement="bottom" data-content="个人信息" onclick="openPageOnTabs('/page/ums/personInfo.html','个人信息')">
                                <!--<a class="J_menuItem" href="{URL_UMS}page/ums/personInfo.jsp">--><i class="fa fa-1x fa-user" aria-hidden="true"></i> <span id="userName" style="font-size: 16px;"></span>
                                <!--</a>-->
                            </li>
                            <li style="font-size: 20px;padding: 0px 10px;" data-toggle="popover" title="" data-container="body" data-trigger="hover"
                                data-toggle="popover" data-placement="bottom" data-content="注销" onclick="logout()">
                                <i class="fa fa-1x fa-power-off" aria-hidden="true"></i> <span style="font-size: 16px;">退出</span>
                            </li>
                        </ul>
                        <div class="clear"></div>
                    </div>
                    <!--/顶部工具栏-->
                </div>
            </nav>
        </div>
        <div class="row content-tabs">
            <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs J_menuTabs">
                <!--tab页标题,与content-main里面的iframe要一一对应(data-id)-->
                <div class="page-tabs-content">
                    <a href="javascript:;" class="active J_menuTab" data-id="home">首页</a>
                </div>
            </nav>
            <button class="roll-nav roll-right J_tabRight"><i class="fa fa-forward"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown J_tabClose" data-toggle="dropdown">关闭操作<span class="caret"></span>
                </button>
                <ul role="menu" class="dropdown-menu dropdown-menu-right">
                    <li class="J_tabShowActive"><a>定位当前选项卡</a>
                    </li>
                    <li class="divider"></li>
                    <li class="J_tabCloseAll"><a>关闭全部选项卡</a>
                    </li>
                    <li class="J_tabCloseOther"><a>关闭其他选项卡</a>
                    </li>
                </ul>
            </div>
            <a href="javascript:logout();" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
        </div>
        <!--iframe容器-->
        <div class="row J_mainContent" id="content-main" style="">
            <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="/page/home.html" frameborder="0" data-id="home" seamless></iframe>
        </div>
        <div class="footer">
            <div class="pull-right">&copy; 2018 <a href="http://www.imrookie.cn" target="_blank">imrookie's blog</a>
            </div>
        </div>
    </div>
    <!--右侧部分结束-->
</div>
<!--右侧边栏结束-->
</div>

<!--配置信息-->
<script src="/static/js/config.js"></script>
<!--jquery-->
<script src="/static/plugin/jquery/jquery-3.3.1.js"></script>
<script src="/static/plugin/jquery/jquery.cookie.js"></script>
<!--bootstrap-->
<script src="/static/plugin/bootstrap/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="/static/plugin/other/html5shiv.js"></script>
<script src="/static/plugin/other/respond.min.js"></script>
<![endif]-->
<!--layui-->
<script src="/static/plugin/layui-2.4.3/layui.all.js"></script>
<!--ztree-->
<script src="/static/plugin/zTree/js/jquery.ztree.all.js"></script>
<!--common-->
<script src="/static/js/common.js"></script>
<!--jo-->
<script src="/static/plugin/jo/jo.js"></script>
<script src="/static/plugin/jo/jo-adapt.js"></script>
<script src="/static/plugin/jo/jo-page-view.js"></script>
<script src="/static/plugin/jo/jo-page-form.js"></script>
<script src="/static/plugin/jo/jo-listener.js"></script>

<!--H+首页相关js-->
<script src="/static/plugin/index_hplus/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/static/plugin/index_hplus/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/static/plugin/index_hplus/js/hplus.js"></script>
<!--tab选项卡形式展示网页,要在所有相关的菜单(.J_menuItem)生产后加载-->
<script type="text/javascript" src="/static/plugin/index_hplus/js/contabs.js"></script>
<script src="/static/plugin/index_hplus/js/plugins/pace/pace.min.js"></script>
<!--h+首页js增强-->
<script src="/static/plugin/index_hplus/ext_topmenu.js"></script>
<script type="text/javascript">

    //注销登录
    function logout(){
        jo.confirm("您确定要注销登录吗?", {title:"退出"}, function(){
            if(window.sessionStorage){
                sessionStorage.removeItem(LOCAL_STORAGE_KEY_TOKEN);//删除本地存储
            }
            window.location.href = URL_UMS + "sso/logout?currentPageUrl=" + encodeURIComponent(window.location.href) + "&currentTopPageUrl=" + encodeURIComponent(top.location.href);
        });
    }
    $(function(){
        //固定顶部
        $(".navbar-static-top").removeClass("navbar-static-top").addClass("navbar-fixed-top");
        $("body").addClass("fixed-nav");
        if(typeof (URL_MENU) == "string"){
            //加载菜单
            jo.postAjax(URL_MENU,{},function(json){
                if(json && json.code == 0){
                    var menus = json.data;
                    drawingTopMenu(menus);//渲染顶部菜单
                }else{
                    jo.alert(jo.getDefVal(json.info, "获取菜单异常!"));
                }
            });
        }else{
            console.warn("未配置菜单服务地址（URL_MENU）！");
        }

        initUserInfo();

        /*var json = {"code":0,"info":"成功","data":[{"id":"NAV_UMS","name":"统一用户","href":"","parent":null,"parentId":"ROOT","parentName":null,"icon":"fa-users","type":"1","level":1,"num":210,"children":[{"id":"NAV_UMS_USER","name":"用户管理","href":"/page/ums/userList.html","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-street-view","type":"1","level":2,"num":120,"children":null,"root":true},{"id":"NAV_UMS_ORG","name":"组织机构管理","href":"/page/ums/deptList.html","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-cubes","type":"1","level":2,"num":150,"children":null,"root":true},{"id":"NAV_UMS_DEPT_USER","name":"机构用户","href":"/page/ums/orgUser.html","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-id-badge","type":"1","level":2,"num":155,"children":null,"root":true},{"id":"NAV_ROLE_MANAGE","name":"角色权限","href":"","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-id-card","type":"1","level":2,"num":160,"children":[{"id":"NAV_UMS_NAVIGATE","name":"资源管理","href":"{URL_UMS}page/ums/navigateList.html","parent":null,"parentId":"NAV_ROLE_MANAGE","parentName":null,"icon":"fa-list","type":"1","level":3,"num":100,"children":null,"root":true},{"id":"NAV_UMS_BUTTON","name":"按钮管理","href":"/page/ums/buttonList.html","parent":null,"parentId":"NAV_ROLE_MANAGE","parentName":null,"icon":"fa-toggle-on","type":"1","level":3,"num":110,"children":null,"root":true},{"id":"NAV_UMS_ROLE","name":"角色管理","href":"{URL_UMS}page/ums/roleList.html","parent":null,"parentId":"NAV_ROLE_MANAGE","parentName":null,"icon":"fa-user-circle-o","type":"1","level":3,"num":170,"children":null,"root":true},{"id":"NAV_UMS_ROLE_USER","name":"角色用户","href":"{URL_UMS}page/ums/roleUserList.html","parent":null,"parentId":"NAV_ROLE_MANAGE","parentName":null,"icon":"fa-drivers-license-o","type":"1","level":3,"num":175,"children":null,"root":true},{"id":"NAV_UMS_AUTH","name":"角色授权","href":"{URL_UMS}page/ums/grantAuth.html","parent":null,"parentId":"NAV_ROLE_MANAGE","parentName":null,"icon":"fa-braille","type":"1","level":3,"num":180,"children":null,"root":true}],"root":true},{"id":"NAV_UMS_SSO","name":"单点登录","href":"","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-dot-circle-o","type":"1","level":2,"num":170,"children":[{"id":"NAV_UMS_SESSION","name":"会话管理","href":"{URL_UMS}page/ums/ssoSessionList.html","parent":null,"parentId":"NAV_UMS_SSO","parentName":null,"icon":"fa-commenting-o","type":"1","level":2,"num":130,"children":null,"root":true},{"id":"NAV_UMS_LGLOG","name":"登录日志","href":"{URL_UMS}page/ums/loginLogList.html","parent":null,"parentId":"NAV_UMS_SSO","parentName":null,"icon":"fa-file-text-o","type":"1","level":2,"num":140,"children":null,"root":true}],"root":true},{"id":"NAV_UMS_CONFIG","name":"UMS配置","href":"/page/ums/umsConfigList.html","parent":null,"parentId":"NAV_UMS","parentName":null,"icon":"fa-cogs","type":"1","level":2,"num":190,"children":null,"root":true}],"root":true},{"id":"NAV_CMS","name":"业务配置","href":"","parent":null,"parentId":"ROOT","parentName":null,"icon":"fa-th-large","type":"1","level":1,"num":220,"children":[{"id":"NAV_CMS_GEN","name":"智能代码生成","href":"{URL_CMS}page/cms/gen/genMainList.html","parent":null,"parentId":"NAV_CMS","parentName":null,"icon":"fa-file-code-o","type":"1","level":2,"num":100,"children":null,"root":true},{"id":"NAV_DBDOC","name":"数据库文档生成","href":"/page/cms/dbExcelGenerate.html","parent":null,"parentId":"NAV_CMS","parentName":null,"icon":"fa-file-word-o","type":"1","level":2,"num":110,"children":null,"root":true},{"id":"NAV_CMS_DB_BACKUP","name":"数据库备份","href":"/page/cms/dbBackup.html","parent":null,"parentId":"NAV_CMS","parentName":null,"icon":"fa-database","type":"1","level":2,"num":115,"children":null,"root":true},{"id":"NAV_CMS_ADMIN_REGION","name":"行政区划管理","href":"/page/cms/administrativeRegionList.html","parent":null,"parentId":"NAV_CMS","parentName":null,"icon":"fa-institution","type":"1","level":2,"num":120,"children":null,"root":true}],"root":true},{"id":"NAV_MONITOR_CENTER","name":"监控中心","href":"","parent":null,"parentId":"ROOT","parentName":null,"icon":"fa-television","type":"1","level":1,"num":230,"children":[{"id":"NAV_MONITOR_DRUID","name":"Druid连接池","href":"/druid/index.html","parent":null,"parentId":"NAV_MONITOR_CENTER","parentName":null,"icon":"fa-database","type":"1","level":2,"num":100,"children":null,"root":true},{"id":"NAV_MONITER_LOG_CONSOLE","name":"实时日志","href":"/page/log/console.html","parent":null,"parentId":"NAV_MONITOR_CENTER","parentName":null,"icon":"fa-file-text-o","type":"1","level":2,"num":200,"children":null,"root":true},{"id":"NAV_MONITER_LOG_HISTORY","name":"历史日志","href":"/page/log/history.html","parent":null,"parentId":"NAV_MONITOR_CENTER","parentName":null,"icon":"fa-file-zip-o","type":"1","level":2,"num":300,"children":null,"root":true}],"root":true},{"id":"NAV_FS","name":"文件系统","href":"","parent":null,"parentId":"ROOT","parentName":null,"icon":"fa-folder-open","type":"1","level":1,"num":240,"children":[{"id":"NAV_FS_MANAGE","name":"文件管理","href":"/page/fs/fileManager.html","parent":null,"parentId":"NAV_FS","parentName":null,"icon":"fa-list-ol","type":"1","level":2,"num":100,"children":null,"root":true},{"id":"NAV_FS_VIEW","name":"浏览文件","href":"/page/fs/fileView.html","parent":null,"parentId":"NAV_FS","parentName":null,"icon":"fa-file-pdf-o","type":"1","level":2,"num":200,"children":null,"root":true},{"id":"NAV_FS_STATIS","name":"文件统计","href":"/page/fs/fileStatis.html","parent":null,"parentId":"NAV_FS","parentName":null,"icon":"fa-pie-chart","type":"1","level":2,"num":300,"children":null,"root":true}],"root":true},{"id":"NAV_USEDOC","name":"帮助文档","href":"","parent":null,"parentId":"ROOT","parentName":null,"icon":"fa-graduation-cap","type":"1","level":1,"num":900,"children":[{"id":"NAV_HELPER_BOOKS_REMOTE","name":"Young组件","href":"/page/help/index.html","parent":null,"parentId":"NAV_USEDOC","parentName":null,"icon":"fa-book","type":"1","level":2,"num":100,"children":null,"root":true},{"id":"NAV_HELP_BTN_AUTH","name":"按钮权限演示","href":"/page/demo/btnAuth.html","parent":null,"parentId":"NAV_USEDOC","parentName":null,"icon":"fa-tint","type":"1","level":2,"num":120,"children":null,"root":true},{"id":"NAV_HELP_UPLOAD","name":"文件上传演示","href":"/page/demo/upload.html","parent":null,"parentId":"NAV_USEDOC","parentName":null,"icon":"fa-file-pdf-o","type":"1","level":2,"num":140,"children":null,"root":true}],"root":true}],"callback":"","unique":null};
        var menus = json.data;
        drawingTopMenu(menus);*/
    });
    //返回顶部最多加载几个菜单
    function getTopMaxMenuNum(){
        var headerWidth = $('.head-bar')[0].offsetWidth;//总宽度
        var titleWidth = $('.logo-bar')[0].offsetWidth;//logo和系统名宽度
        var toolWidth = $('.tools-ul')[0].offsetWidth;//logo和系统名宽度
        var useableWidth = headerWidth - titleWidth - toolWidth - 100;//可以用来展示顶部菜单的宽度
        if(useableWidth < 0){
            return 0;
        }
        var topMaxMenuNum = parseInt(useableWidth / 120);//最多可以展示多少个顶部菜单
        return topMaxMenuNum;
    }
    //顶部菜单点击事件-在左侧展开子菜单,被点击页的打开由a标签处理
    $(document).on("click", ".top-menu-bar>.top-menu-item", function(){
        var menuId = $(this).attr('menuId');
        $('.top-menu-item').removeClass('active');
        $(this).addClass('active');
        drawingLeftMenu(topMenuMap[menuId]);
    });
    var topMenuMap = {};//顶部菜单与子菜单映射
    //渲染顶部菜单
    function drawingTopMenu(menus){
        var maxNum = getTopMaxMenuNum();//顶部能放下多少个菜单
        if(maxNum < 1){//顶部装不下菜单时,降级到左侧加载
            drawingLeftMenu(menus);
            return;
        }

        if(!menus || menus.length < 1){
            return;
        }

        //渲染顶部一级菜单
        var _top = '';
        if(menus.length <= maxNum){//顶部能放下所有一级菜单则全部正常显示
            for(var i=0;i<menus.length;i++){
                var menu = menus[i];//菜单
                if(i == 0){
                    _top += getNavUnitHtml(menu, 1, 'top-menu-item active', true, menu.id);//顶部菜单html
                    drawingLeftMenu(menu.children);//默认加载第一个菜单的子菜单
                }else{
                    _top += getNavUnitHtml(menu, 1, 'top-menu-item', true, menu.id);//顶部菜单html
                }
                topMenuMap[menu.id] = menu.children;//保存菜单对应关系
            }
        }else{
            var moreMenus = [];
            //顶部无法一次性放下所有的一级菜单时,先放maxNum-1个菜单,第maxNum个位置放"更多"
            for(var i=0;i<menus.length;i++){
                var menu = menus[i];//菜单
                if(i < maxNum - 1){
                    if(i == 0){
                        _top += getNavUnitHtml(menu, 1, 'top-menu-item active', true, menu.id);//顶部菜单html
                        drawingLeftMenu(menu.children);//默认加载第一个菜单的子菜单
                    }else{
                        _top += getNavUnitHtml(menu, 1, 'top-menu-item', true, menu.id);//顶部菜单html
                    }
                    topMenuMap[menu.id] = menu.children;//保存菜单对应关系
                }else{
                    moreMenus.push(menu);
                }
            }
            var m = {icon:'fa-ellipsis-h', name:'更多'};
            _top += getNavUnitHtml(m, 1, 'top-menu-item top-menu-item-more', true, "___TOP_MORE_MENUS");//"更多"
            topMenuMap["___TOP_MORE_MENUS"] = moreMenus;//更多
        }

        $('.top-menu-bar').html(_top);
    }
    //渲染左侧菜单
    function drawingLeftMenu(menus){
        if(menus && menus.length > 0){
            var _html = '<li style="height: 42px;line-height: 42px;padding-left: 22px;color: #76838f;font-size: 12px;">菜单栏</li>';
            for(var i=0;i<menus.length;i++){
                var menu = menus[i];
                _html += getNavUnitHtml(menu, 1);
            }
            $("#side-menu").html(_html);//插入菜单
            //当有且只有1个根节点时,自动展开
            loadMenuIndex();//刷新菜单的索引
            $("#side-menu").metisMenu();//初始化菜单插件
        }
    }
    //查询登录用户
    function initUserInfo(){
        jo.postAjax("{URL_UMS}ums/user/queryMyInfo", {}, function(json){
            if(json && json.code == "0" && json.data && json.data.length > 0){
                var personInfo = json.data[0];
                var userInfo = personInfo.userInfo;
                $("#userName").text(userInfo.name);
            }
        }, true);
    }
</script>

</body>
</html>
